using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iopt.solvency.pillarone.client.desktop.Views;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;
using System.Xml.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;

namespace iopt.solvency.pillarone.client.desktop.ViewModels
{
    public class ModelDefinition : DefinitionBase
    {
    
        public ModelDefinition()
        {
            DefaultEntity = new ModelEntityDefinition(this);
            this.Entities = new ObservableCollection<ModelEntityDefinition>();
            this.Relations = new ObservableCollection<ModelRelationDefinition>();
            FilePath = Guid.NewGuid().ToString().Replace("-", "") + ".cs";
            Entities.Add(DefaultEntity);
        }
        public string FilePath { get; set; }

        public ModelEntityDefinition DefaultEntity { get; set; }
    
        public System.Collections.ObjectModel.ObservableCollection<ModelEntityDefinition> Entities { get; private set; }
        public System.Collections.ObjectModel.ObservableCollection<ModelRelationDefinition> Relations { get;  private set; }
    
        protected internal override System.Xml.Linq.XElement GetXml()
        {
            return new XElement("Model", DefaultEntity.GetXml());
        }
    }
}
